What is the lifecycle of a Service Worker (install → activate → fetch)? How do you handle cache versioning and old worker cleanup?
Service Worker lifecycle: install (caching), activate (cleanup old caches), fetch (intercept requests). Use cache version names (e.g., 'v2') and delete old caches in activate event.